﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using Lokad.Monitoring.Persistence.Entities;

namespace Lokad.Monitoring.Persistence.Mappings
{
    public class EndpointMap : ClassMap<Endpoint>
    {
        public EndpointMap()
        {
            Id(x => x.Id).Length(16);
            Map(x => x.Frequency);
            Map(x => x.LastRetrieved);
            Map(x => x.Url).Length(255).Not.Nullable();
            Map(x => x.BasicAuth).Length(255);
            HasMany(x => x.Responses).Cascade.All().Inverse();
        }
    }
}
